package com.loanapp.service;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.loanapp.domain.CreditHistoryBean;

public class MessageSenderCreditProcessImpl implements
		MessageSenderCreditProcess {

	private static Log log = LogFactory
			.getLog(MessageSenderCreditProcessImpl.class);

	private JmsSenderCreditProcess jmsSender = null;

	public JmsSenderCreditProcess getJmsSender() {
		return this.jmsSender;
	}

	public void setJmsSender(JmsSenderCreditProcess jmsSender) {
		this.jmsSender = jmsSender;
	}

	public void send(CreditHistoryBean creditHistory) {
		try {
			jmsSender.sendMessage(creditHistory);

			log.debug("Message sent.");
		} catch (Exception e) {
			log.error(e, e);
		}
	}

}
